﻿// -----------------------------------------------------------------------
// <copyright file="FilterContract.cs">
// Copyright (c) 2013 Andrey Veselov. All rights reserved.
// License:  Microsoft Public License (MS-PL)
// Contacts: http://andrey.moveax.com  andrey@moveax.com
// </copyright>
// -----------------------------------------------------------------------

namespace PortableImagingLibrary.Png.Filters
{
    using System.Diagnostics.Contracts;

    [ContractClassFor(typeof(IFilter))]
    internal abstract class FilterContract : IFilter
    {
        public void ReconstructLine(byte[] sourceLine, byte bytesPerSample)
        {
            Contract.Requires(sourceLine != null);
            Contract.Requires(2 <= sourceLine.Length);
            Contract.Requires(0 < bytesPerSample && bytesPerSample < 8); // max 8 bytes per pixel (16bit RGBA)
        }

        public void FilterLine(byte[] sourceLine, byte bytesPerSample)
        {
            Contract.Requires(sourceLine != null);
            Contract.Requires(1 <= sourceLine.Length);
            Contract.Requires(0 < bytesPerSample && bytesPerSample < 8); // max 8 bytes per pixel (16bit RGBA)
        }
    }
}
